# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from pydantic import BaseModel, Field


class WebSearch(BaseModel):
    """ 搜索配置Vo """
    class EngineParams(BaseModel):
        search_engine: str = Field(max_length=200, description="搜索引擎")
        api_key: str = Field(default="", max_length=2000, description="引擎密钥")
        points: int = Field(default=0, ge=0, le=999999999, description="所需积分")

    status: int = Field(default=0, ge=0, le=1, description="是否开启")
    engine: str = Field(default="zhipu", max_length=100, description="默认引擎: [zhipu]")
    zhipu: EngineParams = Field(description="智谱搜索")


"""--------------- Separator ---------------"""


class AiDialogIn(BaseModel):
    """ 对话配置参数 """
    default_robot: str = Field(default="", max_length=32, description="默认智能体")
    currency_unit: str = Field(default="", max_length=10, description="自定义单位")
    win_watermark: str = Field(default="", max_length=100, description="对话窗水印")
    web_search: WebSearch = Field(description="联网搜索")


"""--------------- Separator ---------------"""


class AiDialogVo(BaseModel):
    """ 对话配置Vo """
    default_robot: str = Field(description="默认智能体")
    currency_unit: str = Field(description="自定义单位")
    win_watermark: str = Field(description="对话窗水印")
    web_search: WebSearch = Field(description="联网搜索")
